package com.g3d.types;

public class G3DColor implements Comparable<G3DColor>
{

	public G3DColor()
	{
		this.r = 0.0f;
		this.g = 0.0f;
		this.b = 0.0f;
		this.a = 0.0f;
	}
	
	public G3DColor(float r, float g, float b, float a)
	{
		this.r = r;
		this.g = g;
		this.b = b;
		this.a = a;
	}
	
	public G3DColor clone()
	{
		return new G3DColor(this.r, this.g, this.b, this.a);
	}
	
	public float r;
	public float g;
	public float b;
	public float a;
	
	@Override
	public int compareTo(G3DColor another) 
	{
		if(this.r == another.r && this.g == another.g && this.b == another.b && this.a == another.a)
			return 0;
		else
			return 1;
	}
	
	public float[] colorArray()
	{
		float[] color = new float[4];
		color[0] = this.r;
		color[1] = this.g;
		color[2] = this.b;
		color[3] = this.a;
		return color;
	}
}
